<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>css | Web学习笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="何">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    
    <link rel="prev" href="../html/html.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2"
        data-chapter-title="css"
        data-filepath="css/css.md"
        data-basepath=".."
        data-revision="Mon Apr 16 2018 19:40:01 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="html/html.html">
            
                
                    <a href="../html/html.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2" data-path="css/css.html">
            
                
                    <a href="../css/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Web学习笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h3 id="welcome-to-css">Welcome to CSS</h3>
<h2 id="1css-&#x9009;&#x62E9;&#x5668;">1.css &#x9009;&#x62E9;&#x5668;</h2>
<pre><code>    /*    *{} &#x901A;&#x914D;&#x9009;&#x62E9;&#x5668;     *&#x4EE3;&#x8868;&#x6240;&#x6709;&#x5143;&#x7D20;---&#x4E00;&#x822C;&#x91CD;&#x7F6E;&#x6837;&#x5F0F;&#x7684;&#x65F6;&#x5019;&#x4F1A;&#x5C06;&#x6D4F;&#x89C8;&#x5668;&#x81EA;&#x5E26;&#x7684;&#x6837;&#x5F0F;&#x8986;&#x76D6;    */*{}
        div{
            background:aliceblue;
            /*&#x5143;&#x7D20;&#x9009;&#x62E9;&#x5668;-----&#x6807;&#x7B7E;&#x540D;{}  &#x6240;&#x6709;&#x7684;&#x6807;&#x7B7E;&#x4E5F;&#x4F1A;&#x6709;&#x540C;&#x6837;&#x7684;&#x6837;&#x5F0F;*/
        }

        div,a{
            &#x7FA4;&#x7EC4;&#x9009;&#x62E9;&#x5668;&#x4EE5;,&#x9694;&#x5F00;
        }

        #qq{

            id&#x9009;&#x62E9;&#x5668;:#+&quot;id&#x540D;&quot;.---id&#x53EA;&#x80FD;&#x552F;&#x4E00;,&#x4E0D;&#x80FD;&#x6709;&#x91CD;&#x590D;
        }
        .dd{
            class&#xFF08;&#x7C7B;)&#x9009;&#x62E9;&#x5668;:.+&quot;class&#x540D;&quot;-----&#x540C;&#x4E00;&#x7C7B;&#x7684;

        }
        div a{

            &#x540E;&#x4EE3;&#x9009;&#x62E9;&#x5668;
        }
        div&gt;a{
            &#x5B50;&#x9009;&#x62E9;&#x5668;,&#x53EA;&#x4F1A;&#x9009;&#x4E2D;&#x76F4;&#x5C5E;&#x513F;&#x5B50;&#x5143;&#x7D20;
        }

        p+p{
            &#x5144;&#x5F1F;&#x9009;&#x62E9;&#x5668;:
            a+b  &#x7D27;&#x63A5;a&#x5143;&#x7D20;&#x7684;b&#x5143;&#x7D20;&#xFF08;a&#x7684;&#x540E;&#x4E00;&#x4E2A;)
        }

        .div~p{
            /*div&#x540E;&#x9762;&#x6240;&#x6709;&#x7684;&#x5144;&#x5F1F;p*/
            background: #0000FF;
        }



        /*6.css&#x9009;&#x62E9;&#x5668;
</code></pre><p>1) &#x5E38;&#x7528;&#x9009;&#x62E9;&#x5668;
    a.&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x7B26;
    b.&#x7C7B;&#x9009;&#x62E9;&#x5668;
    c.id&#x9009;&#x62E9;&#x5668;
    d.&#x5173;&#x8054;&#x9009;&#x62E9;&#x5668;
    e.&#x7EC4;&#x5408;&#x9009;&#x62E9;&#x5668;
&#x6CE8;:&#x6240;&#x6709;&#x6807;&#x7B7E;&#x90FD;&#x5171;&#x6709;&#x7684;&#x5C5E;&#x6027;: id&#xFF0C;class&#xFF0C;title&#xFF0C;style</p>
<p>2) &#x57FA;&#x672C;&#x9009;&#x62E9;&#x5668;
&#x2022; :first-child -----&#x7B2C;&#x4E00;&#x4E2A;&#x5B50;&#x5143;&#x7D20;
&#x2022; :first-letter------&#x9996;&#x4E2A;&#x5B57;&#x6BCD;
&#x2022; :first-line-------&#x7B2C;&#x4E00;&#x884C;&#xFF08;P&#x6807;&#x7B7E;&#x91CC;&#xFF09;
&#x2022; :last-child----&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;
&#x2022; :nth-child(2)-----&#x7B2C;&#xFF08;&#x51E0;&#x4E2A;&#xFF09;&#x5143;&#x7D20;
              &#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;
&#x2022; :hover
&#x2022; :focus
&#x2022; ::selection</p>
<p>5) &#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;
&#x2022; [id]
&#x2022; [id=use1]------
&#x2022; [name^=en]-------&#x5C5E;&#x6027;&#x4EE5;&#x4EC0;&#x4E48;&#x5F00;&#x5934;
&#x2022; [name~=linux]----&#x5C5E;&#x6027;&#x5305;&#x542B;&#x8BCD;
&#x2022; [name$=en]-------&#x5C5E;&#x6027;&#x4EE5;&#x4EC0;&#x4E48;&#x7ED3;&#x5C3E;
&#x2022; [name*=en]-----&#x5C5E;&#x6027;&#x542B;&#x6709;&#x90E8;&#x5206;&#x7684;&#x5185;&#x5BB9;&#xFF08;en&#xFF09;</p>
<pre><code>         * 
         * 
         * 
         * css&#x7684;&#x4F18;&#x5148;&#x7EA7;&#xFF1A;&#x5185;&#x5D4C;&#x6837;&#x5F0F;&gt;&#x9875;&#x5185;&#x6837;&#x5F0F;&gt;&#x9875;&#x5916;&#x6837;&#x5F0F;---&#x5C31;&#x8FD1;&#x539F;&#x5219;&#xFF0C;&#x7531;&#x4E0A;&#x5F80;&#x4E0B;&#x8BFB;&#x53D6;&#xFF0C;&#x6700;&#x540E;&#x7684;&#x6837;&#x5F0F;&#x4E3A;&#x6700;&#x7EC8;&#x7684;&#x9875;&#x9762;&#x6E32;&#x67D3;&#x6837;&#x5F0F;
         * css&#x7684;&#x8BFB;&#x53D6;&#x540E;&#x7684;&#x5BFB;&#x627E;&#x5143;&#x7D20;&#x89C4;&#x5F8B;&#x662F;&#x4ECE;&#x5C0F;&#x5230;&#x5927;
         * &#x7B2C;&#x4E00;&#x4E2A;&#x6027;&#x80FD;&#x597D;&#x7684;&#x539F;&#x56E0;&#x662F;&#xFF0C;&#x5148;&#x627E;&#x5230;&#x552F;&#x4E00;&#x7684;id&#xFF0C;&#x8981;&#x4E48;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#xFF0C;&#x8981;&#x4E48;&#x627E;&#x4E0D;&#x5230;
         * .div #app
         * &#x5148;&#x627E;&#x5230;&#x7C7B;&#xFF0C;&#x53EF;&#x80FD;&#x4F1A;&#x5B58;&#x5728;&#x591A;&#x4E2A;&#x7C7B;&#xFF0C;&#x67E5;&#x8BE2;&#x6B21;&#x6570;&#x53EF;&#x80FD;&#x591A;&#x4E8E;&#x524D;&#x8005;
         * #app .div
         * */
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../html/html.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: html"><i class="fa fa-angle-left"></i></a>
        
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
